<template>
  <div class="scrollYItem" @click="todetail(ID)">
    <img class="yimg" :src="imgSrc"/>
    <p class="ytitle">{{title}}</p>
    <p class="price">￥{{price}}</p>
    <s class="orprice">￥{{orprice}}</s>
  </div>
</template>
Y
<script>
    export default {
        name: "mainYScrollItem",
        props:['imgSrc','title','price','orprice','ID'],
        methods:{
          todetail(ID) {
            console.log('点击了scrollitem', ID);
            this.$router.push('/pages/details/main?ID=' + ID);
          }
        },
    }
</script>

<style scoped>
  .scrollYItem{
    height: 235px;
    width: 150px;
    margin: 5px 14px 10px 14px;
    display: inline-block;
    overflow: hidden;
    border-radius: 5px;
    background-color: white;
    box-shadow: 5px 5px 10px #dad9d1;
  }
  .yimg{
    width: 150px;
    height: 150px;
  }
  .ytitle{
    width: 140px;
    height: 43px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal !important;
    line-height: 22px;
    margin-top: 10px;
    margin-bottom: 4px;
    padding-left: 5px;
    padding-right: 5px;
  }
  .price{
    font-size: 15px;
    display: inline-block;
    margin-right: 10px;
    /*margin-top: 10px;*/
    color: #ff702d;
  }
  .orprice{
    font-size: 10px;
    text-decoration: line-through;
    display: inline-block;
    color: #aaaaaa;
  }
</style>
